<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/header::commonlinks(~{::title},~{::link})">
    <title>markdown编辑器</title>

    <link rel="stylesheet" th:href="@{/plugins/editormd/css/editormd.css}">
    <link rel="stylesheet" th:href="@{/admin/editor/editor.css}">
    <link rel="stylesheet" th:href="@{/plugins/jquerytag/css/amsify.suggestags.css}">
</head>
<body class="hold-transition sidebar-mini layout-fixed layout-navbar-fixed">
<div class="wrapper">
    <div th:include="common/header::topnavbar"></div>
    <div th:include="common/header::leftaside(activename='editor')"></div>
    <!-- 内容区 -->
    <div class="content-wrapper">
        <!--内容区头部 -->
        <div class="content-header">
            <div class="row m-1">
                <input type="text" style="display: none" id="userid" placeholder="用户id"  th:value="${article==null?'':article.userId}">

                <div class="col-md-9"><input type="text" style="width: 70%;" id="title" placeholder="此处定义标题" th:value="${article==null?'':article.title}"></div>
                <div class="col-ms-2 ml-2"> <button type="button" class="btn btn-primary submodal" data-target="#submodal" data-toggle="modal">保存文章</button></div>
            </div>
        </div>
        <div class="row  m-1">
            <div class="editormd" id="test-editormd">
                <textarea class="editormd-markdown-textarea"  name="test-editormd-markdown-doc" th:text="${article==null?'':article.contentMd}" id="content"></textarea>
                <!-- 第二个隐藏文本域，用来构造生成的HTML代码，方便表单POST提交，这里的name可以任意取，后台接受时以这个name键为准 -->
                <textarea class="editormd-html-textarea"  name="editormd-html-textarea"  id="htmlContent"></textarea>
            </div>
        </div>
        <!-- /内容区头部 -->

        <!-- 内容区主体 -->

        <!-- /内容区主体 -->
    </div>
    <div id="submodal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="submodallabel"
         aria-hidden="true">
        <form  class="needs-validation validateForm" novalidate>
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <h4 class="modal-title" id="submodallabel">发布文章</h4>
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    </div>
                    <div class="modal-body">
                        <div class="articletitle">
                            <span>文章标签：</span>
<!--                            <div id="DemoDiv"></div>-->
                            <button type="button" class="btn titlebtn btn-primary fas fa-plus-square">添加文章标签</button>
                            <input type="text" class="form-control input1" name="title"/>
                        </div>
                        <div class="articlefenlei">
                            <span>分类专栏：</span>
                            <div class="fenleicontent">
                                <button type="button"  class="btn fenleibtn btn-primary fas fa-plus-square">新建分类专栏</button>
                                <input type="text" class="form-control input2"  name="fenlei" th:value="${article==null?'':article.categories}"/>
                                <input type="text" class="form-control fenleitxt" style="display: none" disabled="disabled" th:value="${article==null?'':article.categories}"/>
                                <div class="checkfenlei">
                                    <div class="checkfenleibody">
                                        <div class="checkfenleibodytitle">已创分类</div>
<!--                                        <div class="form-check form-check-inline">-->
<!--                                            <input class="form-check-input" type="checkbox" name="fenleiselected" id="fenleiCheckbox1" value="java">-->
<!--                                            <label class="form-check-label" for="fenleiCheckbox1">java</label>-->
<!--                                        </div>-->
<!--                                        <div class="form-check form-check-inline">-->
<!--                                            <input class="form-check-input" type="checkbox" name="fenleiselected" id="fenleiCheckbox2" value="JavaScript">-->
<!--                                            <label class="form-check-label" for="fenleiCheckbox2">JavaScript</label>-->
<!--                                        </div>-->
<!--                                        <div class="form-check form-check-inline">-->
<!--                                            <input class="form-check-input" type="checkbox" name="fenleiselected" id="fenleiCheckbox3" value="python">-->
<!--                                            <label class="form-check-label" for="fenleiCheckbox3">python</label>-->
<!--                                        </div>-->
                                    </div>

                                </div>
                            </div>
                        </div>
                        <div class="articcomment">
                            <div class="form-check">
                                <input class="form-check-input" type="radio" name="articcomment" id="articcomment1" value="true" checked>
                                <label class="form-check-label" for="articcomment1">
                                    开启评论
                                </label>
                            </div>
                            <div class="form-check">
                                <input class="form-check-input" type="radio" name="articcomment" id="articcomment2" value="false">
                                <label class="form-check-label" for="articcomment2">
                                    关闭评论
                                </label>
                            </div>
                        </div>
                        <div class="articrelease">
                            <div class="form-check">
                                <input class="form-check-input" type="radio" name="articrelease" id="articrelease1" value="true" checked>
                                <label class="form-check-label" for="articrelease1">
                                    现在发布
                                </label>
                            </div>
                            <div class="form-check">
                                <input class="form-check-input" type="radio" name="articrelease" id="articrelease2" value="false">
                                <label class="form-check-label" for="articrelease2">
                                    存为草稿
                                </label>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-info" data-dismiss="modal"><i class="fas fa-meh">退出</i></button>
                            <button type="button" class="btn btn-primary valid-button delebtn"><i class="fas fa-check">保存</i></button>
                        </div>
                    </div><!-- /.modal-content -->
                </div>
            </div>
        </form>
    </div>
    <!-- /内容区 -->
    <!-- 右侧栏 -->
    <div th:include="~{common/header::rightaside}"></div>
    <!-- /右侧栏 -->
    <!-- 底部栏 -->
    <div th:include="~{common/footer::footer}"></div>
    <!--所有js必须放在jq下面-->
    <div th:replace="common/header::commonjs(~{::script})">
        <!--        私有的js-->
        <script th:src="@{/plugins/editormd/editormd.js}"></script>
<!--        <script th:src="@{/plugins/jquerytag/js/typeahead.bundle.js}"></script>-->
        <script th:src="@{/plugins/jquerytag/js/jquery.amsify.suggestags.js}"></script>

        <script th:src="@{/admin/editor/index.js}"></script>
    </div>
</div>

</body>
</html>